<?php include("../../includes/includes.php"); ?>
<?
if (!isset($_GET['leagueId'])) {
	header( 'Location: ../notAuthenticated.php' );
	die();
}
$leagueId = $_GET['leagueId'];
$type = $_GET['type'];
?>
<body>
<head>
<style type="text/css">
body
{
background-color: #fff;
}
</style></head>
<?connect($config)?>
<?if ($type == "draftHome") {
$currentPick = getCurrentPick($leagueId);	
	?>
<table align="center" width="90%">
			<tr>
	<c:set var="lastRound" value="0" />
	<? 
	$lastRound = 0;
	$draftItems = getDraft($leagueId, true);
	$count = count($draftItems);
	for ($i = 0; $i < $count; $i++) {
		if ($draftItems[$i]->round != $lastRound) {
		?>
	<tr>
		<td colspan="2"><br><br><b><font size="3" colspan='3'>Round <?echo $draftItems[$i]->round?></font></b><br><br></td>
	</tr>
	<?$lastRound = $draftItems[$i]->round;
	}
	?>
	<tr>
		<?if ($draftItems[$i]->pickNumber == $currentPick) {?>
			<td width="5%"><b>#<?echo $draftItems[$i]->pickNumber?></b></td>
			<td width="10%"><b><?echo $draftItems[$i]->coachName?></b></td>
			<td width="60%"></td>
		<?} else {?>
			<td width="5%">#<?echo $draftItems[$i]->pickNumber?></td>
			<td width="10%"><?echo $draftItems[$i]->coachName?></td>
			<?if ($draftItems[$i]->state == 'PICKED' || $draftItems[$i]->state == 'PICKED_INFORMED') {?>
				<td width="60%"><?echo getPlayerDisplayForPlayer($draftItems[$i]->player)?></td>
		<?	}
		    else if ($draftItems[$i]->state == 'SKIPPED' || $draftItems[$i]->state == 'SKIPPED_INFORMED') {?>
		    	<td width="60%"><font color="red">SKIPPED</font></td>
		    <?}
		}?>
	</tr>
	<?}?>
</table>
<?} else if ($type == "APL") {?>
	<?php include("../home/displayAPL.php"); ?>
<?} else if ($type == "preSeasonScores") {?>
	<?php include("../round/preSeasonScores.php"); ?>
<?} else if ($type == "preSeasonScoresWeek2") {?>
	<?php include("../round/preSeasonScoresWeek2.php"); ?>
<?} else if ($type == "preSeasonScoresWeek3") {?>
	<?php include("../round/preSeasonScoresWeek3.php"); ?>
<?} else if ($type == "selectedTeams") {?>
	<?php include("../home/selectedTeams.php"); ?>
<?} else if ($type == "selectedTeamsForWeek") {?>
	<?php include("../round/selectedTeamsForWeek.php"); ?>
<?} else if ($type == "displayRoundByAverages") {?>
	<?php include("../round/displayRoundByAverages.php"); ?>	
<?} else if ($type == "kppStatusReview") {?>
	<?php include("../kppStatusReview/kppStatusReview.php"); ?>
<?} else if ($type == "trades") {?>
	<?echo getTradeHTMLForForum($leagueId);?>
<?} else if ($type == "results") {
        $currentRound = getCurrentRound();
	$round = $currentRound;
	if (isset($_GET['round'])) {
		$round = $_GET['round'];
	}
?>
	<?php include("../round/displayRoundAsHTML.php"); ?>
<?} else if ($type == "ladder") {?>
<?php include("../html/ladder-" . $leagueId . ".htm"); ?>
<?}?>
<?mysql_close();?>
</html>